#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int a[1000010],s[1000010],t,n;
char c[1000010];
bool dfsok;
bool judge(){
	for(int i=1;i<=n;i++){
		if(s[i]!=s[2*n-i+1]) return false;
	}
	return true;
}
bool dfs(int cnt,int l,int r){
	if(cnt>2*n&&judge()){
		return true;
	}
	else if(cnt>2*n&&(!judge())){
		dfsok = 1;
		for(int i=1;i<=n*2;i++){
			if(c[i]=='L'){
				dfsok=0;
			}
		}
		return false;
	}
	else if(cnt>n&&a[l]!=s[n*2-cnt+1]&&a[r]!=s[n*2-cnt+1]){
		return false;
	}
	c[cnt]='L';
	s[cnt] = a[l];
	if(dfs(cnt+1,l+1,r)) return true;
	if(dfsok) return false;
	c[cnt]='R';
	s[cnt] = a[r];
	if(dfs(cnt+1,l,r-1)) return true;
	if(dfsok) return false;
}
int main(){
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	scanf("%d",&t);
	for(int k=1;k<=t;k++){
		scanf("%d",&n);
		
		for(int i=1;i<=n*2;i++){
			scanf("%d",&a[i]);
		}
		if(dfs(1,1,2*n)){
			for(int i=1;i<=n*2;i++){
				printf("%c",c[i]);
			}
			printf("\n");
		}
		else printf("-1\n");
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
